package com.hopes.bizz.hazard.alarm.vo;

import com.hopes.bizz.basic.common.constant.enums.ParkBasicModDictEnum;
import com.hopes.bizz.hazard.common.constant.enums.HazardModDictEnum;
import com.hopes.bizz.hazard.common.logic.AlarmLogic;
import com.hopes.boss.admin.api.resolver.DictResolver;
import lombok.Data;

import java.io.Serializable;

/**
 * @author daijie
 * @version 1.0
 * @date 2023/11/20 19:16
 * @Description:
 */
@Data
public class HazAlarmStatistics implements Serializable {
    private static final long serialVersionUID = 7779057675827855712L;

    /**
     * 危险源
     */
    private Long hazardSourceId;

    /**
     * 报警因子
     */
    private Long monitorFactorId;

    /**
     * 报警次数
     */
    private Integer num;
    /**
     * 报警时长
     */
    private Long time;

    public String getTimeDesc() {
        return AlarmLogic.buildDurationTimeDesc( this.time * 60);
    }

    public String getNumStr() {
        return num + "次";
    }

    public String getHazardSourceIdStr() {
        return DictResolver.getItemLabelByValue(ParkBasicModDictEnum.hazard_source, this.hazardSourceId);
    }

    public String getMonitorFactorIdStr() {
        return DictResolver.getItemLabelByValue(HazardModDictEnum.factor_config, this.monitorFactorId);
    }
}
